<template>
    <div class="mars-m-style">
        <blockIndexNavBar title="请假详情"></blockIndexNavBar>

        <lee-card>
            <van-cell-group v-for="(key,val) in leaveObj" :key="new Date()">
                <van-cell :title="val"
                          :value="key"
                />


            </van-cell-group>
        </lee-card>

        <!--    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">-->
        <!--      <van-list-->
        <!--          v-model="loading"-->
        <!--          :finished="finished"-->
        <!--          finished-text="没有更多了"-->
        <!--          @load="getData"-->
        <!--      >-->
        <!--        <lee-card v-for="item in dataList" :key="item._id">-->
        <!--          <van-cell-group>-->
        <!--            <van-cell title="请假人员"-->
        <!--                      :value="item.true_name"-->
        <!--            />-->
        <!--            <van-cell title="所在部门"-->
        <!--                      :value="item.dep_name"-->
        <!--            />-->
        <!--            />-->
        <!--          </van-cell-group>-->
        <!--        </lee-card>-->
        <!--      </van-list>-->
        <!--    </van-pull-refresh>-->
    </div>
</template>

<script>
import {Config} from "@/config/formDataOptions";
import blockIndexNavBar from "@/components/blockIndexNavBar";
import LeeCard from "@/uitl/card";
import {API_URL} from "../../../config/urlInfo";

export default {
    name: "leaveInfo",
    components: {
        LeeCard,
        blockIndexNavBar,
    },
    data() {
        return {
            contract_number: "",
            list: [],
            loading: false,
            finished: false,
            refreshing: false,
            dataList: [],
            currentPage: 1,
            count: 0,
            leaveObj: {}
        };
    },
    mounted() {
        this.getData()
    },
    methods: {
        tabformatDate(item) {
            let data = item
            if (data == null || data === '') {
                return ""
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate()
        },
        onRefresh() {
            // 清空列表数据
            this.finished = false;

            // 重新加载数据
            // 将 loading 设置为 true，表示处于加载状态
            this.loading = true;
            this.dataList = [];
            this.currentPage = 1;
            this.getData();
        },

        getData() {
            Config.getDatas(API_URL.leaveInfo, {}, (res) => {
                console.log(res)
                this.leaveObj = res
            }, this)
        }
    }
}
</script>


<style scoped lang="less">
.search-btn {
    .van-button {
        width: 48%;
        margin-right: 1%;
    }

    background: #fff;
    text-align: center;
    padding: 11px 0;
}

.list-btn {
    .van-button {
        width: 45%;
        margin-right: 2%;
        float: right;
    }
}

.wt-card {
    margin: 0.4rem;
    background: #fff;
    overflow: hidden;
    border-radius: 0.3rem;
    padding: 0.4rem;
    box-shadow: 0 0 0.2rem #ccc;
    border-bottom: 0.1rem solid #ccc;
}


.icons-warp {
    border-radius: 25px;

    .float-icon-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 50px;
        height: 50px;

        img {
            width: 25px;
            height: 25px;
            margin-bottom: 3px;
        }

        span {
            font-size: 9px;
            color: #666666;
        }
    }
}

</style>